<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客管理登录</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
</head>
<body>
<div class="animated bounceInDown">
<div class="m-container-small" style="max-width: 35em !important; padding-top: 15em !important;">
    <div class="ul container">
        <div class="ui middle aligned center aligned grid">
            <div class="column">
                <h2 class="ui teal image header">
                    <img src="../../static/images/logo.png" th:src="@{/images/logo.png}" class="image">
                    <div class="content">
                        博客管理后台
                    </div>
                </h2>
                <form class="ui large form error" method="post" th:action="@{/admin/login}">
                    <div class="ui segment">
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="user icon"></i>
                                <input type="text" id="username" name="username" placeholder="用户名">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="lock icon"></i>
                                <input type="password" id="password" name="password" placeholder="密码">
                            </div>
                        </div>
                        <button class="ui fluid large teal submit button">登录</button>
                    </div>
                    <div class="ui error mini message" th:text="${session.user}"></div>
<!--                    <div class="ui  mini message" th:text="${session.msg}"></div>-->
                </form>
            </div>
        </div>
    </div>
  </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
<script src="../../static/js/ribbon.min.js" th:src="@{/js/ribbon.min.js}"></script>
<script src="../../static/js/jquery-2.2.3.min.js" th:src="@{/js/jquery-2.2.3.min.js}"></script>
</body>
 <script>
     // function login() {
     //     var password = document.getElementById("password").value;
     //     var username = $.trim($('#username').val());
     //     $.ajax({
     //        url:"/login",
     //         type:"post",
     //         data:{'username':username,'password':password},
     //         success:function (data) {
     //             if(data===0){
     //                 alert("账号密码错误！");
     //             }else{
     //                 console.log(data);
     //                 window.location.href="index1";
     //             }
     //         }
     //     });
     // }
     // $('.ui.form').from({
     //     username : {
     //         title : {
     //             identifier: 'username',
     //             rules: [{
     //                 type : 'empty',
     //                 prompt: '请输入用户名'
     //             }]
     //         }
     //     },
     //     password : {
     //         title : {
     //             identifier: 'password',
     //             rules: [{
     //                 type : 'empty',
     //                 prompt: '请输入密码'
     //             }]
     //         }
     //     }
     //
     // });

 </script>
</html>